package jee.boot.module.iexp.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


/**
 * 线程池配置
 * 当线程数小于核心线程数时，创建线程。
 * 当线程数大于等于核心线程数，且任务队列未满时，将任务放入任务队列。
 * 当线程数大于等于核心线程数，且任务队列已满
 * 若线程数小于最大线程数，创建线程
 * 若线程数等于最大线程数，抛出异常，拒绝任务
 */
@Configuration
@ConfigurationProperties(prefix = "spring.thread-pool-config-big")
public class ThreadPoolConfigBig {
    /**
     * 是否开启导入导出功能
     */
    private Boolean enable = false;
    /**
     * 监听数据库任务表时间间隔(毫秒)默认10秒
     */
    private Integer monitorIntervalMillisecond = 10 * 1000;
    /**
     * 只监控自己产生的任务,(按服务器名称区分)
     */
    private Boolean monitorMyselfTask = true;

    /**
     * 核心线程数
     */
    private Integer corePoolSize = 50;
    /**
     * 任务队列容量（阻塞队列）
     */
    private Integer queueCapacity = 100;
    /**
     * 最大线程数
     */
    private Integer maxPoolSize = 100;

    public Integer getMonitorIntervalMillisecond() {
        return monitorIntervalMillisecond;
    }

    public void setMonitorIntervalMillisecond(Integer monitorIntervalMillisecond) {
        this.monitorIntervalMillisecond = monitorIntervalMillisecond;
    }

    public Integer getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(Integer corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public Integer getQueueCapacity() {
        return queueCapacity;
    }

    public void setQueueCapacity(Integer queueCapacity) {
        this.queueCapacity = queueCapacity;
    }

    public Integer getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(Integer maxPoolSize) {
        this.maxPoolSize = maxPoolSize;
    }

    public Boolean getMonitorMyselfTask() {
        return monitorMyselfTask;
    }

    public void setMonitorMyselfTask(Boolean monitorMyselfTask) {
        this.monitorMyselfTask = monitorMyselfTask;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }


}
